how to sovle day 16 question in hackerrank